﻿using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace WebApplication1.Core.Domain.Entities {

    [Table("louyuan")]
    public class LouYuan {
        [Key]
        [Column("louyuanid")]
        public ushort LouYuanID { get; set; }

        [Required(ErrorMessage = "楼院名称不能为空")]
        [Column("mingcheng", TypeName = "TEXT(20)")]
        [StringLength(20, ErrorMessage = "字符不得超过20个")]
        public string MingCheng { get; set; }

        [Column("fangwushuliang", TypeName = "INTEGER(4)")]
        [Range(0, 9999, ErrorMessage = "房屋套数不得超过9999个")]
        public int? FangWuShuLiang { get; set; }

        [Column("dongshu", TypeName = "INTEGER(3)")]
        [Range(0, 999, ErrorMessage = "楼栋数量不得超过999个")]
        public int? DongShu { get; set; }

        [Column("jianzhumianji", TypeName = "REAL(4,2)")]
        [Range(0, 9999.99, ErrorMessage = "建筑面积最大不能超过9999.99")]
        public float? JianZhuMianJi { get; set; }

        [Column("jianchengshijian", TypeName = "TEXT(4)")]
        [StringLength(4, ErrorMessage = "字符不得超过4个")]
        public string? JianChengShiJian { get; set; }

        [Column("shequid")]
        [ForeignKey("SheQu")]
        public ushort? SheQuID { get; set; }

        [Column("dizhi", TypeName = "TEXT(50)")]
        [StringLength(50, ErrorMessage = "字符不得超过50个")]
        public string? DiZhi { get; set; }

    }
}
